-
Notifications
You must be signed in to change notification settings - Fork 501
Add Enum Ratio to PlutusTx stdlib. #7406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
591ff50 to
5b497a7
Compare
SeungheonOh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but I think it's okay to keep fromGHC and toGHC as is. We have other helpers in plutus-tx and plutus-ledger-api that won't work on-chain but is quite useful.
I thought we are trying to keep plutus-tx on-chain only. But I am open to discussions about this and if so , bring it back. |
I was mostly about keeping |
5b497a7 to
197c088
Compare
|
I put the fromGHC / toGHC back and renamed them to from/toHaskellRatio |
197c088 to
86b832a
Compare
SeungheonOh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Left some comments
86b832a to
3e3ca27
Compare
Added an Enum Rational instance that mimicks that of GHC and Haskell report.
I also removed the toGHC/fromGHC from plutustx since they don't work on-chain.
I think it is straightforward to re-create these two-functions for off-chain use, simply by a combination of numerator and denominator.
Pre-submit checklist: